package com.wechat.bot.common.log;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class Log {

    private static Logger LOGGER = LoggerFactory.getLogger("qh-service-V1.0");

    public static void debug(String message) {
        LOGGER = LoggerFactory.getLogger(new Exception().getStackTrace()[1].getClassName());
        LOGGER.debug(message);
    }

    public static void debug(String message, Throwable ex) {
        LOGGER = LoggerFactory.getLogger(new Exception().getStackTrace()[1].getClassName());
        LOGGER.debug(message, ex);
    }

    public static void info(String message) {
        LOGGER = LoggerFactory.getLogger(new Exception().getStackTrace()[1].getClassName());
        LOGGER.info(message);
    }

    public static void info(String message, Throwable ex) {
        LOGGER = LoggerFactory.getLogger(new Exception().getStackTrace()[1].getClassName());
        LOGGER.info(message, ex);
    }

    public static void warn(String message) {
        LOGGER = LoggerFactory.getLogger(new Exception().getStackTrace()[1].getClassName());
        LOGGER.warn(message);
    }

    public static void warn(String message, Throwable ex) {
        LOGGER = LoggerFactory.getLogger(new Exception().getStackTrace()[1].getClassName());
        LOGGER.warn(message, ex);
    }

    public static void error(String message) {
        LOGGER = LoggerFactory.getLogger(new Exception().getStackTrace()[1].getClassName());
        LOGGER.error(message);
    }

    public static void error(String message, Throwable ex) {
        LOGGER = LoggerFactory.getLogger(new Exception().getStackTrace()[1].getClassName());
        LOGGER.error(message, ex);
    }
}
